
from fusion.db.db import DB

db = DB('~/.fusion/fusion.db')

for c in db.list_collections():

    name = db.get_text(c, 'info/title') or c
    print '%s:' % name.encode('utf-8'),

    keys = db.keys(c)
    print '%d keys,' % len(keys),

    size = 0
    for k in keys:
        size += db.get_size(c, k)
    print '%d bytes' % size

db.close()
